package com.woniuxy01;

import java.rmi.server.ServerCloneException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.InputMismatchException;
import java.util.Scanner;

class Aaa{
    public void aaa() throws CloneNotSupportedException {

    }
}
class Bbb extends Aaa{
    @Override
    public void aaa() /*throws ServerCloneException*/ {

    }
}

/**
 * @author 作者
 * @create 2025-06-06 9:44
 */
public class Test01 {
    public static void main(String[] args) {
        test04(5);
        System.out.println("over");
    }

    private static void test04(int x) {
        try {
            test03(x);
        } catch (Exception e) {
            System.out.println(e.getMessage());
            e.printStackTrace();
            //将受异常转成非受查异常
            throw new RuntimeException(e);
        }
    }

    private static void test03(int x) throws Exception {
        if (x == 1) {
            System.out.println("ok");
        } else {
            //抛出受查异常
            throw new Exception("无法转换");
        }
    }

    private static void test02() throws ParseException {
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        Date date = df.parse("2000-1a-1");
        System.out.println(date);
    }


    private static void test01() {
        Scanner sc = new Scanner(System.in);
        int i = sc.nextInt();
        System.out.println(i);
    }
}
